<template>
    <div>
      <h2>一辆车{{ car.brand }} 的价值：{{ car.price }}万</h2>
      <button @click="ChangePrice">修改价格</button>
      <ul>
        <li v-for="item in games" :key="item.id">
            {{ item.name }}
        </li>
      </ul>
    </div>
</template>

<script setup lang="ts" name="car">
    import { reactive } from "vue";
    let car = reactive({
        brand:'奔驰',
        price:100
    })
    function ChangePrice() {
        car.price+=10
    }
    let games=[{
        id:"0",
        name:"王者荣耀"
    },{
        id:"1",
        name:"和平精英"
    },{
        id:"2",
        name:"穿越火线"
    },{
        id:"3",
        name:"香肠派对"
    }]
</script>

<style></style>